import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', () => {
  // 响应式的state状态--在不同的组件或者视图之间被分享分享
  const count = ref(0)
  //计算属性--getter
  const doubleCount = computed(() => count.value * 2)
  //对state状态进行修改--action
  function increment() {
    count.value++
  }

  return { count, doubleCount, increment }
})
